/*数据过滤*/

// 身份证号脱敏第6位开始替换8个*
let IDcardHide = num => {
    let data = num.replace(/(\d{6})\d{8}(\d*)/, '$1********$2')
    return data
};
// 手机号脱敏第3位开始替换4个*
let telHide = num => {
    let data = num.replace(/(\d{3})\d{4}(\d*)/, '$1****$2')
    return data
};
//性别
let sex = num => {
    switch (Number(num)) {
        case 0:
            return '男';
        case 1:
            return '女'
    }
};

export default {
    IDcardHide,
    telHide,
    sex
}
//组件中使用：{{数据|telHide}}